<!-- headline -->
<div id="header">
    <h2>guestapp /compose</h2>
    <br>
    [<a href="/select">display entries</a>]
</div>

<!-- main -->
<div id="main">
    <!-- messages 
    array looks like:
    array(
        "err" => array(
            "error message 1 ..",
            "error message 2 .."
        ),
        "succ" => array(
            "succes message here .."
        )
    )
    -->
    <?php if (!empty($this->mesg)): ?>
        <?php foreach ($this->mesg as $type => $value): ?>
        <?php for ($m = 0; $m < count($value); $m++): ?>
        <em class="mesg <?php echo $type; ?>"><?php echo $value[$m]; ?></em>
        <?php endfor; endforeach; ?>
    <?php endif; ?>

    <!-- form -->
    <form id="insert" action="/insert" method="post">
        <div class="row">
            <label for="name">Name:</label>
            <input type="text" id="name" name="name" value="<?php echo @$_POST["name"]; ?>">
        </div>
        <div class="row">
            <label for="entry">Text:</label>
            <textarea id="entry" name="entry"><?php echo @$_POST["entry"]; ?></textarea>
        </div>
        <input type="submit" name="insert" value="compose" <?php echo $allow !== true ? 'disabled="disabled"' : ''; ?>>
    </form>
</div>